<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const obj = {
      info: 'hello',
      msg: 'nihao'
    }

    const obj2 = {
      gender: 'male'
    }

    // const obj1 = {
    //   age: 12,
    //   obj: obj,
    //   obj2: obj2
    // }
    // // 等效写法
    // const obj1 = {
    //   age: 12,
    //   obj,
    //   obj2
    // }

    function mapState() {
      return {
        gender: 'male'
      }
    }

    const obj3 = mapState()

    const obj1 = {
      age: 12,
      ...obj,
      // ...obj2
      // ...mapState()
      ...obj3
    }

    // 此时obj1里面有几个属性？
    console.dir(obj1)

    // ----------------------
    // const arr1 = [12, 13]
    // const arr2 = [15, 16]
    // const arr = [...arr1, ...arr2]
    // const arr = [arr1, arr2]
    // console.log(arr)

  </script>
</body>
</html>
